package abstact;

public class Test {

    public Test(){
        MainBoard mb=new MainBoard();
        Toshiba tsb=new Toshiba();
        Kingston ks=new Kingston();
        mb.insert(ks);
        mb.insert(tsb);
        //匿名内部类
        USB qc=new USB() {
            @Override
            public void start() {
                 System.out.println("七彩U盘启动");
            }

            @Override
            public void stop() {
                System.out.println("七彩U盘停止");
            }
        };
        mb.insert(qc);
    }
    public static void main(String[] agrs) {
        new Test();
    }
}
